package com.woniu.command.handcommand;

import com.woniu.command.Command;
import com.woniu.command.handler.HandCommandHandler;
import com.woniu.outlet.po.ProcessHandover;
import com.woniu.outlet.po.Progress;
import com.woniu.util.ApplicationContextHolder;
import com.woniu.util.SnowflakeIdGenerator;

import java.util.Date;


public class UrgentHandCommand implements Command<ProcessHandover> {
    private HandCommandHandler handler;



    public UrgentHandCommand ( ) {
        //ApplicationContextHolder.getApplicationContext()拿到ApplicationContext
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(HandCommandHandler.class);
    }

    @Override
    public void execute (ProcessHandover processHandover) {
        processHandover.setSpare1("未报工");
        processHandover.setHandoverTime(new Date());

//        需要从生产计划那边查询,根据订单编号查询生产计划id
//        progress.setProPlanId(processHandover.getProPlanId());

        handler.urgent(processHandover);
    }
}
